package com.supermarket.api.repository;

import com.supermarket.api.entity.CartEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 购物车相关
 * @author 李其伟
 * @date 2023/11/10
 */
@Repository
public interface CartRepository extends JpaRepository<CartEntity, Long> {

    List<CartEntity> findAllByUserIdOrderByUpdateTimeDesc(Long userId);

    CartEntity findAllByUserIdAndSkuCode(Long userId, String skuCode);
}
